#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
    vector<int> twoSum(vector<int>& price, int target)
    {
        int len = price.size();
        int left = 0, right = len - 1;
        sort(price.begin(), price.end());
        while (left < right)
        {
            if (price[left] + price[right] > target)
                right--;
            else if (price[left] + price[right] < target)
                left++;
            else
                return { price[left], price[right] };
        }
        return {};
    }
};